﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HMI_BR_tech
{
    public partial class FormSystemManagement : Form
    {
        List<string> listUserName = new List<string>();//保存用户ID，用户表
        List<int> listFunc = new List<int>();//功能表
        struct structUserFunc
        {
            string strUsername;
            string strSecKey;
            int iFunc;
        }

        List<structUserFunc> listUserFunc = new List<structUserFunc>();//用户功能表
            
        enum enumlistFunc
        {
            iSystemManagement = 1,
            iFuncManagement = 2,
            iInfoManagement = 4,
            iCalibrationManagement = 8,
            iLogManagement = 16,
            iStopOperating = 32,
            iManualOperating = 64,
            iFormulaConfigue = 128,
            iMonitorChart = 256,
            iProductionChart = 512,
        };

        public FormSystemManagement()
        {
            InitializeComponent();

            listFunc.Add((int)enumlistFunc.iSystemManagement);
            listFunc.Add((int)enumlistFunc.iFuncManagement);
            listFunc.Add((int)enumlistFunc.iInfoManagement);
            listFunc.Add((int)enumlistFunc.iCalibrationManagement);
            listFunc.Add((int)enumlistFunc.iLogManagement);
            listFunc.Add((int)enumlistFunc.iStopOperating);
            listFunc.Add((int)enumlistFunc.iManualOperating);
            listFunc.Add((int)enumlistFunc.iFormulaConfigue);
            listFunc.Add((int)enumlistFunc.iMonitorChart);
            listFunc.Add((int)enumlistFunc.iProductionChart);
        }

        public void toshow()
        {
            //先找一找文件是否存在，若不存在，则创建之。
            if (!System.IO.File.Exists("user.xml"))
            {
                commonfunc.createXmlFile("user.xml");
            }
            loadAllUser();
            showAllUser();
        }

        public void loadAllUser()//加载xml文件到列表
        {
            //commonfunc.loadXmlFile(listUserFunc, "user.xml");
        
        
        }

        public void showAllUser()
        { 
        
        }
    }
}
